package br.com.gr.jcash.dao;

import br.com.gr.jcash.dmp.Usuario;
import br.com.gr.jcash.exception.JCashException;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class UsuarioDAO extends AbstractDAO<Usuario, Long> {

    @PersistenceContext(unitName = "jcash-PU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public UsuarioDAO() {
        super(Usuario.class);
    }

    @Override
    public List<Usuario> buscarTodos(Usuario usuario) throws JCashException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<Usuario> buscarPorFaixa(Usuario usuario, int[] faixa) throws JCashException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Long count(Usuario usuario) throws JCashException {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    public Usuario buscarPorLogin(String login) throws JCashException {
        return buscarUnico("Usuario.buscarPorLogin", login);
    }
}
